package com.ramnight.sql2.core;

import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import com.ramnight.sql2.util.SqlKit;

public class TABLE {
	private static HashMap<String, Set<String>> map = new HashMap<>();
	
	static void init(){
		List<String> tableList = DB.searchCol("show tables");
		for(String table : tableList){
			List<String> colList = DB.searchCol("show columns from " + SqlKit.wrapCol(table));
			map.put(table, new HashSet<String>(colList));
		}
	}
	
	public static Set<String> getCols(String table){
		return map.get(table);
	}
}
